package com.sise.wangzhan.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Classname HelloClient
 * @Description TODO
 * @Date 2020/5/6 22:07
 * @Created by wangzhan
 */
@FeignClient(name = "eureka-feign-hystrix-provider", fallback = HelloClient.HelloClientFallback.class)
public interface HelloClient {

    @RequestMapping(method = RequestMethod.GET,value = "/hello")
    public String hello();

    @Component
    static class HelloClientFallback implements HelloClient{
        @Override
        public String hello(){
            return "error  hello";
        }
    }


}
